__author__ = 'dsteil' import Tkinter from Tkinter import * class GUIExample: def __init__(self): self.__mainWindow = Tkinter.Tk() self.count = IntVar() self.count.set(0) self.up_button = Tkinter.Button(self.__mainWindow, text="Up", command = self.buttonClickedCountUp) self.down_button = Tkinter.Button(self.__mainWindow, text="Down", command = self.buttonClickedCountDown) self.reset_button = Tkinter.Button(self.__mainWindow, text="Reset", command = self.buttonClickedReset) self.count_label = Tkinter.Label(self.__mainWindow, textvariable=self.count) self.up_button.pack() self.down_button.pack() self.reset_button.pack() self.count_label.pack() self.__mainWindow.mainloop() def buttonClickedCountUp(self): self.count.set(self.count.get() + 1) def buttonClickedCountDown(self): self.count.set(self.count.get() - 1) def buttonClickedReset(self): self.count.set(0) gui_Example = GUIExample()